{% extends "base.html" %}

{% block head %}
    <title>Movie Top 250</title>
    <h3>Movie Top 250</h3>
{% endblock %}

{% block body %}


<form class="" method="get" action="{% url movie_db %}">
    {#    {% csrf_token %}#}
    <div class="">
        <input class="" type="text" name="keyword" placeholder="">
        <button class="btn btn-default" type="submit">PostgreSQL</button>
    </div>
</form>

<form class="" method="get" action="{% url movie_es %}">
    {#    {% csrf_token %}#}
    <div class="">
        <input class="" type="text" name="keyword" placeholder="">
        <button class="btn btn-default" type="submit">ElasticSearch</button>
    </div>
</form>


<table class="table table-bordered table-striped">
    <thead>
        <tr>
            <th>排名</th>
            <th>图片</th>
            <th>标题</th>
            <th>链接</th>
            <th>详情</th>
            <th>星级</th>
            <th>评分</th>
            <th>评论</th>
            <th>描述</th>
        </tr>
    </thead>
    <tbody>
        {# {% for movie in movies %} #}
        {% for movie in page.object_list %}
        <tr>
            <td>{{ movie.rank }}</td>
            <td>
                <img src="{{ movie.pic }}">
            </td>
            <td>{{ movie.title }}</td>
            <td>{{ movie.url }}</td>
            <td>{{ movie.desc }}</td>
            <td>{{ movie.star }}</td>
            <td>{{ movie.rate }}</td>
            <td>{{ movie.comment }}</td>
            <td>{{ movie.quote }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>

{% include "pagination_jinja.html" %}

{% endblock %}
